//
//  MyCollectionViewCell.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/10/31.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

-(void)setCellWithModel:(CollectionGoodsModel *)model
{
    [self.goodsImage sd_setImageWithURL:[NSURL URLWithString:model.goods_picture] placeholderImage:PlaceImage];
    self.goodsLabel.text = model.goods_name;
    self.priceLabel.text = model.goods_coupon_price;
    if (model.goods_price) {
        self.oldPirceLabel.text = model.goods_price;
    }else
    {
        self.oldPirceLabel.hidden = YES;
    }
    if (model.goods_status == 2) {
        self.bgView.hidden = NO;
    }
    self.numLabel.hidden = YES;
}

- (void)bindDataWithModel:(OrderListModel *)model
{
    [self.goodsImage sd_setImageWithURL:[NSURL URLWithString:model.goods_picture] placeholderImage:PlaceImage];
    self.goodsLabel.text = model.goods_name;
    self.priceLabel.text = model.goods_discounted_price;
    self.numLabel.text = [NSString stringWithFormat:@"x%@",model.goods_number];
    self.specLabel.text = model.goods_spec_name;
    if (model.goods_price.length > 0) {
        NSMutableAttributedString * string = [[NSMutableAttributedString alloc]initWithString:model.goods_price attributes:@{NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle),NSFontAttributeName:FontSize(14),NSForegroundColorAttributeName:TextLessImportColor}];
        self.oldPirceLabel.attributedText = string;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
